using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Xml.Serialization;
using System.Text.RegularExpressions;


namespace WOWEquipOptimizer
{
    [XmlInclude(typeof(Armor)), XmlInclude(typeof(Gem)), XmlInclude(typeof(WeaponSkill)), XmlInclude(typeof(Ring)), XmlInclude(typeof(Trinket)), XmlInclude(typeof(Weapon))]
    public abstract partial class Item
    {
        public static Attribute getSpecialAttribute(int value, Character target)
        {
            if (!Character.UseSpecials) return new Attribute(AttributeName.None, 0);
            switch (value)
            {
                case 30440214:
                    {
                        return new Attribute(AttributeName.AttackPower, 46.33f);
                    }
                case 19801456:
                    {
                        return new Attribute(AttributeName.Healing, 59.4f);
                    }
                case 1000010:
                    {
                        if (target.CharClass == CharacterClass.Druid || target.CharClass == CharacterClass.Hunter) return new Attribute(AttributeName.None, 0);
                        return new Attribute(AttributeName.Agility, (120 / 4f) * 1.5f); // simplified mongoose
                    }
                case 1000011:
                    {
                        if (target.CharClass == CharacterClass.Druid || target.CharClass == CharacterClass.Hunter) return new Attribute(AttributeName.None, 0);
                        // haste direct is in percent
                        return new Attribute(AttributeName.HasteDirect, (2f / 4f) * 1.5f);  // simplified mongoose
                    }
                case 1000020:
                    {
                        return new Attribute(AttributeName.Strength, (60 / 4) * 1.5f);
                    }
                case 25914748:
                    {
                        // dragonspine trophy, we assume 35% uptime and the effect is 30% haste
                        return new Attribute(AttributeName.HasteRating, 0.35f * 325);
                    }
                case 5710830:
                    {
                        return new Attribute(AttributeName.HasteRating, 0.20f * 212); // dragonmaw/strike
                    }
                case 24031732:
                    {
                        return new Attribute(AttributeName.HasteSpellRating, 175 / 6);
                    }
                case 26860688:
                    {
                            return new Attribute(AttributeName.HasteRating, (1/6f) * 450); // warglaive set
                    }
                default:
                    {
                        // bug fix bug bug bug
                        target.SpecialValues.Add(value.ToString());
                        break;
                    }
            }
            return new Attribute(AttributeName.None, 0);
        }
    }
}
